﻿<Application
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"       
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" 
    xmlns:unsupported="clr-namespace:Microsoft.Phone.Controls.Unsupported"  xmlns:System="clr-namespace:System;assembly=mscorlib" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:Video="clr-namespace:YouTube" 
     xmlns:smf="clr-namespace:Microsoft.SilverlightMediaFramework.Core;assembly=Microsoft.SilverlightMediaFramework.Core.Phone"
	xmlns:smf_converters="clr-namespace:Microsoft.SilverlightMediaFramework.Utilities.Converters;assembly=Microsoft.SilverlightMediaFramework.Utilities.Phone" 
    xmlns:SampleData="clr-namespace:Expression.Blend.SampleData.VideoCollection" 
    x:Class="YouTube.App"
     mc:Ignorable="d" 
    >

    <!--Application Resources-->
    <Application.Resources>
    	
    	<Style x:Key="ReplayButtonStyle" TargetType="Button">
    		<Setter Property="Background" Value="#FF1F3B53"/>
    		<Setter Property="Foreground" Value="#FF000000"/>
    		<Setter Property="Padding" Value="3"/>
    		<Setter Property="BorderThickness" Value="1"/>
    		<Setter Property="BorderBrush">
    			<Setter.Value>
    				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    					<GradientStop Color="#FFA3AEB9" Offset="0"/>
    					<GradientStop Color="#FF8399A9" Offset="0.375"/>
    					<GradientStop Color="#FF718597" Offset="0.375"/>
    					<GradientStop Color="#FF617584" Offset="1"/>
    				</LinearGradientBrush>
    			</Setter.Value>
    		</Setter>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="Button">
    					<Grid>
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="MouseOver"/>
    								<VisualState x:Name="Pressed">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Collapsed</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image1">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Visible</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Disabled"/>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Image x:Name="image" Margin="12" Source="/Microsoft.SilverlightMediaFramework.Core.Phone;component/Images/replay_normal.png">
    							<VisualStateManager.VisualStateGroups>
    								<VisualStateGroup x:Name="CommonStates1">
    									<VisualState x:Name="Normal1"/>
    									<VisualState x:Name="MouseOver1"/>
    									<VisualState x:Name="Pressed1"/>
    									<VisualState x:Name="Disabled1"/>
    								</VisualStateGroup>
    							</VisualStateManager.VisualStateGroups>
    						</Image>
    						<Image x:Name="image1" Margin="12" Source="/Microsoft.SilverlightMediaFramework.Core.Phone;component/Images/replay_pressed.png" Visibility="Collapsed">
    							<VisualStateManager.VisualStateGroups>
    								<VisualStateGroup x:Name="CommonStates2">
    									<VisualState x:Name="Normal2"/>
    									<VisualState x:Name="MouseOver2"/>
    									<VisualState x:Name="Pressed2"/>
    									<VisualState x:Name="Disabled2"/>
    								</VisualStateGroup>
    							</VisualStateManager.VisualStateGroups>
    						</Image>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="ThumbStyle" TargetType="Thumb">
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="Thumb">
    					<Rectangle x:Name="rectangle" Fill="White" Margin="0,15">
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="MouseOver"/>
    								<VisualState x:Name="Pressed"/>
    								<VisualState x:Name="Disabled"/>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    					</Rectangle>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="SMFTimelineStyle1" TargetType="smf:Timeline">
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="smf:Timeline">
    					<Grid x:Name="MainLayout">
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualStateGroup.Transitions>
    									<VisualTransition GeneratedDuration="0:0:0.25"/>
    								</VisualStateGroup.Transitions>
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="MouseOver"/>
    								<VisualState x:Name="Disabled">
    									<Storyboard>
    										<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MainLayout"/>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="FocusStates">
    								<VisualStateGroup.Transitions>
    									<VisualTransition GeneratedDuration="0:0:0.25"/>
    								</VisualStateGroup.Transitions>
    								<VisualState x:Name="Unfocused"/>
    								<VisualState x:Name="Focused"/>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="LiveStates">
    								<VisualState x:Name="Live">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="HorizontalAvailableBar">
    											<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Vod">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="HorizontalAvailableBar">
    											<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="ScrubbingStates">
    								<VisualState x:Name="IsScrubbing">
    									<Storyboard>
    										<DoubleAnimation Duration="0" To="2" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="HorizontalThumb" />
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="IsNotScrubbing"/>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Grid x:Name="HorizontalTemplate" Background="Transparent" Height="37" IsHitTestVisible="True" Margin="1,0" VerticalAlignment="Center">
    							<Grid.ColumnDefinitions>
    								<ColumnDefinition Width="Auto"/>
    								<ColumnDefinition Width="Auto"/>
    								<ColumnDefinition Width="*"/>
    							</Grid.ColumnDefinitions>
    							<RepeatButton x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" BorderBrush="{x:Null}" Grid.Column="2" Foreground="{x:Null}" IsHitTestVisible="False" Margin="0,0,1,0">
    								<RepeatButton.Template>
    									<ControlTemplate>
    										<Rectangle Fill="#FF333333" Margin="0,15" StrokeThickness="0.5"/>
    									</ControlTemplate>
    								</RepeatButton.Template>
    							</RepeatButton>
    							<Border x:Name="HorizontalAvailableBar" BorderThickness="0" Background="#FF5B92E5" Grid.ColumnSpan="3" HorizontalAlignment="Left" Height="7" Margin="1,0,0,0" Opacity="0" Padding="0"/>
    							<RepeatButton x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" BorderBrush="{x:Null}" Grid.Column="0" Foreground="{x:Null}" IsHitTestVisible="False" IsTabStop="False" Margin="1,0,0,0">
    								<RepeatButton.Template>
    									<ControlTemplate>
    										<Rectangle Fill="#FF5B92E5" Margin="0,15" StrokeThickness="0.5"/>
    									</ControlTemplate>
    								</RepeatButton.Template>
    							</RepeatButton>
    							<smf:MarkerItemsControl Grid.ColumnSpan="3" Grid.Column="0" EndPosition="{TemplateBinding EndPosition}" IsLive="{TemplateBinding IsLive}" ItemsSource="{TemplateBinding Markers}" LivePosition="{TemplateBinding LivePosition}" RenderTransformOrigin="0.5,0.5" StartPosition="{TemplateBinding StartPosition}" ThumbWidth="{Binding Width, ElementName=HorizontalThumb}"/>
    							<Thumb x:Name="HorizontalThumb" Background="#00FFFFFF" Grid.Column="1" Height="Auto" RenderTransformOrigin="0.5,0.5" Style="{StaticResource ThumbStyle}" Width="30">
    								<Thumb.RenderTransform>
    									<CompositeTransform/>
    								</Thumb.RenderTransform>
    							</Thumb>
    							<Border BorderBrush="White" BorderThickness="1" Grid.ColumnSpan="3" CornerRadius="2" Margin="0,14"/>
    						</Grid>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="PerformanceProgressBar" TargetType="ProgressBar">
    		<Setter Property="Foreground" Value="#FF1BA1E2"/>
    		<Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
    		<Setter Property="Maximum" Value="100"/>
    		<Setter Property="IsHitTestVisible" Value="False"/>
    		<Setter Property="Padding" Value="{StaticResource PhoneHorizontalMargin}"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="ProgressBar">
    					<unsupported:RelativeAnimatingContentControl HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
    						<unsupported:RelativeAnimatingContentControl.Resources>
    							<ExponentialEase EasingMode="EaseOut" Exponent="1" x:Key="ProgressBarEaseOut"/>
    							<ExponentialEase EasingMode="EaseIn" Exponent="1" x:Key="ProgressBarEaseIn"/>
    						</unsupported:RelativeAnimatingContentControl.Resources>
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Determinate"/>
    								<VisualState x:Name="Indeterminate">
    									<Storyboard RepeatBehavior="Forever" Duration="00:00:04.4">
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="IndeterminateRoot">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Visible</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DeterminateRoot">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Collapsed</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.0" Storyboard.TargetProperty="X" Storyboard.TargetName="R1TT">
    											<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
    											<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
    											<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
    											<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
    										</DoubleAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetProperty="X" Storyboard.TargetName="R2TT">
    											<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
    											<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
    											<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
    											<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
    										</DoubleAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.4" Storyboard.TargetProperty="X" Storyboard.TargetName="R3TT">
    											<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
    											<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
    											<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
    											<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
    										</DoubleAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetProperty="X" Storyboard.TargetName="R4TT">
    											<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
    											<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
    											<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
    											<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
    										</DoubleAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.8" Storyboard.TargetProperty="X" Storyboard.TargetName="R5TT">
    											<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
    											<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
    											<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
    											<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
    										</DoubleAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R1">
    											<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
    											<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
    										</DoubleAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R2">
    											<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
    											<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
    										</DoubleAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.4" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R3">
    											<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
    											<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
    										</DoubleAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R4">
    											<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
    											<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
    										</DoubleAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.8" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R5">
    											<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
    											<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Grid>
    							<Grid x:Name="DeterminateRoot" Margin="{TemplateBinding Padding}" Visibility="Visible">
    								<Rectangle x:Name="ProgressBarTrack" Fill="{TemplateBinding Background}" Height="4" Opacity="0.1"/>
    								<Rectangle x:Name="ProgressBarIndicator" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" Height="4"/>
    							</Grid>
    							<Border x:Name="IndeterminateRoot" Margin="{TemplateBinding Padding}" Visibility="Collapsed">
    								<Grid HorizontalAlignment="Left">
    									<Rectangle Fill="{TemplateBinding Foreground}" Height="8" IsHitTestVisible="False" Width="8" x:Name="R1" Opacity="0" CacheMode="BitmapCache">
    										<Rectangle.RenderTransform>
    											<TranslateTransform x:Name="R1TT"/>
    										</Rectangle.RenderTransform>
    									</Rectangle>
    									<Rectangle Fill="{TemplateBinding Foreground}" Height="8" IsHitTestVisible="False" Width="8" x:Name="R2" Opacity="0" CacheMode="BitmapCache">
    										<Rectangle.RenderTransform>
    											<TranslateTransform x:Name="R2TT"/>
    										</Rectangle.RenderTransform>
    									</Rectangle>
    									<Rectangle Fill="{TemplateBinding Foreground}" Height="8" IsHitTestVisible="False" Width="8" x:Name="R3" Opacity="0" CacheMode="BitmapCache">
    										<Rectangle.RenderTransform>
    											<TranslateTransform x:Name="R3TT"/>
    										</Rectangle.RenderTransform>
    									</Rectangle>
    									<Rectangle Fill="{TemplateBinding Foreground}" Height="8" IsHitTestVisible="False" Width="8" x:Name="R4" Opacity="0" CacheMode="BitmapCache">
    										<Rectangle.RenderTransform>
    											<TranslateTransform x:Name="R4TT"/>
    										</Rectangle.RenderTransform>
    									</Rectangle>
    									<Rectangle Fill="{TemplateBinding Foreground}" Height="8" IsHitTestVisible="False" Width="8" x:Name="R5" Opacity="0" CacheMode="BitmapCache">
    										<Rectangle.RenderTransform>
    											<TranslateTransform x:Name="R5TT"/>
    										</Rectangle.RenderTransform>
    									</Rectangle>
    								</Grid>
    							</Border>
    						</Grid>
    					</unsupported:RelativeAnimatingContentControl>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="EmptyButtonStyle" TargetType="Button">
    		<Setter Property="Background" Value="Transparent"/>
    		<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
    		<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
    		<Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
    		<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
    		<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
    		<Setter Property="Padding" Value="0"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="Button">
    					<Grid Background="Transparent">
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="MouseOver"/>
    								<VisualState x:Name="Pressed" />
    								<VisualState x:Name="Disabled" />
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" CornerRadius="0">
    							<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
    						</Border>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="SMFPlayerStyle1" TargetType="smf:SMFPlayer">
    		<Setter Property="Background" Value="Black"/>
    		<Setter Property="HorizontalAlignment" Value="Stretch"/>
    		<Setter Property="VerticalAlignment" Value="Stretch"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="smf:SMFPlayer">
    					<Grid>
    						<Grid.Resources>
    							<Video:TimeSpanValueConverter x:Key="TimeSpanValueConverter"/>
    						</Grid.Resources>
    						<VisualStateManager.VisualStateGroups>

    							<VisualStateGroup x:Name="PlayStates">
    								<VisualState x:Name="AcquiringLicense"/>
    								<VisualState x:Name="Buffering"/>
    								<VisualState x:Name="ClipPlaying">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="ReplayElement">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<System:Boolean>False</System:Boolean>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="PlayElement">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<System:Boolean>False</System:Boolean>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="TimelineElement">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<System:Boolean>False</System:Boolean>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsHitTestVisible)" Storyboard.TargetName="TimelineElement">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<System:Boolean>False</System:Boolean>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Closed"/>
    								<VisualState x:Name="Individualizing"/>
    								<VisualState x:Name="Opening"/>
    								<VisualState x:Name="Paused"/>
    								<VisualState x:Name="Playing"/>
    								<VisualState x:Name="Stopped"/>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="PosterStates">
    								<VisualState x:Name="PosterHidden">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Poster">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Collapsed</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="PosterVisible">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Poster">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Visible</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="ControlStripStates">
    								<VisualStateGroup.Transitions>
    									<VisualTransition GeneratedDuration="0:0:0.3" To="ControlStripNotVisible">
    										<Storyboard>
    											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ControllerContainer">
    												<DiscreteObjectKeyFrame KeyTime="0:0:0.4">
    													<DiscreteObjectKeyFrame.Value>
    														<Visibility>Collapsed</Visibility>
    													</DiscreteObjectKeyFrame.Value>
    												</DiscreteObjectKeyFrame>
    											</ObjectAnimationUsingKeyFrames>
    										</Storyboard>
    									</VisualTransition>
    									<VisualTransition GeneratedDuration="0:0:0.3" To="ControlStripVisible"/>
    								</VisualStateGroup.Transitions>
    								<VisualState x:Name="ControlStripVisible">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ControllerContainer">
    											<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
    											<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="ControlStripNotVisible">
    									<Storyboard>
    										<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ControllerContainer" />
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ControllerContainer">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Collapsed</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Grid x:Name="PlayerRoot" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Height="{TemplateBinding Height}" Margin="0" VerticalAlignment="{TemplateBinding VerticalAlignment}" Width="{TemplateBinding Width}">
    							<ContentControl x:Name="MediaPresenterElement" HorizontalContentAlignment="Stretch" Height="{TemplateBinding VideoHeight}" IsHitTestVisible="True" Grid.Row="0" VerticalContentAlignment="Stretch" Width="{TemplateBinding VideoWidth}"/>
    							<Image x:Name="Poster" DataContext="{TemplateBinding CurrentPlaylistItem}" Height="{TemplateBinding VideoHeight}" IsHitTestVisible="False" Source="{Binding ThumbSource}" Visibility="Collapsed" Width="{TemplateBinding VideoWidth}"/>
    							<Button x:Name="ControlStripToggleElement" BorderBrush="{x:Null}" Content="Button" Foreground="{x:Null}" Opacity="0"/>
    							<Grid x:Name="ControllerContainer" Background="#7F000000" VerticalAlignment="Bottom">
    								<Grid.RowDefinitions>
    									<RowDefinition Height="Auto"/>
    									<RowDefinition/>
    									<RowDefinition Height="Auto"/>
    								</Grid.RowDefinitions>
    								<TextBlock x:Name="title" Foreground="White" FontSize="{StaticResource PhoneFontSizeLarge}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Margin="32,5,0,0" TextWrapping="Wrap" Text="{Binding CurrentPlaylistItem.Title, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center"/>
    								<StackPanel x:Name="playercontrols" HorizontalAlignment="Center" Margin="0" Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Center" Height="87">
    									<Button  x:Name="ReplayElement" BorderThickness="0" Height="72" Margin="20,0,0,0" Style="{StaticResource ReplayButtonStyle}" Width="72"/>
    									<smf:PlayElement x:Name="PlayElement"  Cursor="Hand" Height="72" Margin="20,0,0,0" PlayState="{TemplateBinding PlayState}" Width="72"/>
    								</StackPanel>
    								<Grid x:Name="timelinecontrols" Grid.ColumnSpan="1" Grid.Column="1" Margin="16,15,16,40" Grid.Row="2">
    									<Grid.ColumnDefinitions>
    										<ColumnDefinition Width="Auto"/>
    										<ColumnDefinition/>
    										<ColumnDefinition Width="Auto" MinWidth="86"/>
    									</Grid.ColumnDefinitions>
                                        <!-- Converter={StaticResource TimeSpanValueConverter}, -->
    									<TextBlock x:Name="CurrentPositionElement" Foreground="White" FontSize="{StaticResource PhoneFontSizeSmall}" FontFamily="Segoe UI Semibold" HorizontalAlignment="Right" Margin="0,0,9,3" TextAlignment="Right" Text="{Binding PlaybackPosition, Converter={StaticResource TimeSpanValueConverter}, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" Width="72"/>
    									<smf:Timeline x:Name="TimelineElement" Cursor="Hand" Chapters="{TemplateBinding Chapters}" Grid.Column="1" EndPosition="{TemplateBinding EndPosition}" Foreground="{x:Null}" HorizontalContentAlignment="Stretch" IsLive="{TemplateBinding IsMediaLive}" LivePosition="{TemplateBinding LivePosition}" Margin="0" StartPosition="{TemplateBinding StartPosition}" TimelineMarkers="{TemplateBinding TimelineMarkers}" VerticalAlignment="Center" Style="{StaticResource SMFTimelineStyle1}"/>
    									<TextBlock x:Name="CurrentDurationElement" Grid.Column="2" Foreground="White" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="Segoe UI Semibold" HorizontalAlignment="Left" Margin="9,5,0,5" Opacity="0.4" Text="{Binding EndPosition, Converter={StaticResource TimeSpanValueConverter}, RelativeSource={RelativeSource TemplatedParent}}" Width="77" />
    								</Grid>
    							</Grid>
    						</Grid>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Color x:Key="ForegroundGrey">#FF6C6A6A</Color>
    	<Color x:Key="ForegroundBlue">#FF0088FD</Color>
    	<Color x:Key="ForegroundRed">#FFFF3333</Color>
    	<Color x:Key="ForegroundBlack">#FF000000</Color>
    	<Color x:Key="ForegroundBlackDim">#18000000</Color>
    	<Color x:Key="ForegroundGreyUnselected">#80000000</Color>
    	<Color x:Key="BackgroundWhite">#FFFFFFFF</Color>

    	<System:Double x:Key="FontSizeHeading1">72</System:Double>
    	<System:Double x:Key="FontSizeHeading2">42.67</System:Double>
    	<System:Double x:Key="FontSizeHeading3">50</System:Double>
    	<System:Double x:Key="FontSizeDetailsVideoTitle">24</System:Double>
    	<System:Double x:Key="FontSizeBodyLarge">22</System:Double>
    	<System:Double x:Key="FontSizeBody">18</System:Double>
    	<System:Double x:Key="FontSizeBodySmall">16</System:Double>
    	<System:Double x:Key="FontSizePageTitle">22.67</System:Double>

    	<SolidColorBrush x:Key="Youtube_BackgroundBrush" Color="{StaticResource BackgroundWhite}"/>
    	<SolidColorBrush x:Key="Youtube_ForegroundBrush"  Color="{StaticResource ForegroundBlack}"/>
    	<SolidColorBrush x:Key="Youtube_ForegroundDimBrush"  Color="{StaticResource ForegroundBlackDim}"/>
    	<SolidColorBrush x:Key="Youtube_ForegroundInactiveBrush"  Color="{StaticResource PhoneInactiveColor}"/>
    	<SolidColorBrush x:Key="Youtube_ForegroundStandoutBrush"  Color="{StaticResource ForegroundRed}"/>
    	<SolidColorBrush x:Key="Youtube_AccentBrush"  Color="{StaticResource PhoneAccentColor}"/>
    	<SolidColorBrush x:Key="Youtube_SeekBarBrush"  Color="#7FF4F4F5"/>

    	<Style x:Key="Body" TargetType="TextBlock">
            <!--<Setter Property="Foreground" Value="{StaticResource PhoneContrastForegroundBrush}"/>-->
    		<Setter Property="Foreground" Value="{StaticResource Youtube_ForegroundBrush}"/>
    		<Setter Property="FontFamily" Value="Segoe WP"/>
    		<Setter Property="FontSize" Value="{StaticResource FontSizeBody}"/>
    	</Style>

    	<Style x:Key="YouTubeButtonStyle" TargetType="Button">
    		<Setter Property="Background" Value="Transparent"/>
    		<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
    		<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
    		<Setter Property="BorderThickness" Value="0"/>
    		<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
    		<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
    		<Setter Property="Padding" Value="0,0,0,0"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="Button">
    					<Grid Background="Transparent">
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="MouseOver"/>
    								<VisualState x:Name="Pressed">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource Youtube_BackgroundBrush}"/>
    										</ObjectAnimationUsingKeyFrames>
    										<DoubleAnimation Duration="0" To="0.90" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="ButtonBackground" d:IsOptimized="True"/>
    										<DoubleAnimation Duration="0" To="0.90" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="ButtonBackground" d:IsOptimized="True"/>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Disabled">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="FocusStates">
    								<VisualState x:Name="Focused"/>
    								<VisualState x:Name="Unfocused"/>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" RenderTransformOrigin="0.5,0.5" >
    							<Border.RenderTransform>
    								<CompositeTransform/>
    							</Border.RenderTransform>
    							<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
    						</Border>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
    	<shell:PhoneApplicationService 
    		Launching="Application_Launching" Closing="Application_Closing" 
    		Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>